package com.wyl

import javax.servlet.http.HttpServlet
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

class HelloServlet : HttpServlet() {

    override fun doPost(req: HttpServletRequest, resp: HttpServletResponse) {
        val parameter = req.getParameter("method")
        println(parameter)
//        resp.sendRedirect()
        req.session.setAttribute("msg",parameter)
        req.getRequestDispatcher("/WEB-INF/jsp/test.jsp").forward(req, resp)
    }

    override fun doGet(req: HttpServletRequest, resp: HttpServletResponse) = this.doPost(req, resp)
}